<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Openfire: Upgrade Guide</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>

<div id="pageContainer">

<a name="top"></a>

    <div id="pageHeader">
        <div id="logo"></div>
        <h1>Upgrade Guide</h1>
    </div>
    <div class="navigation">
        <a href="index.html">&laquo; Back to documentation index</a>
    </div>

    <div id="pageBody">

<p>Upgrading Openfire is almost as easy as installing Openfire from scratch. As part of the upgrade process
    it is highly recommended to backup your current installation and database. Having backups will let you
    easily rollback to a previous state and ensure that you have not lost vital information. The rest of
    the document describes the common steps to perform a successful upgrade.

    The new version of Openfire will be installed over the existing version and all settings and data will be retained.

<h2>Standard Upgrade</h2>
<ul>
<h3>Windows EXE</h3>
    <ol>
        <li>Stop Openfire (when using a service, stop it manually).</li>
        <li>Backup the Openfire installation directory. The default is _C:\Program Files\Openfire_</li>
        <li>Backup the Openfire database. Note that the embedded database is backed up in step 2.</li>
        <li>Run the installer for the new version of Openfire (note that the installer MUST point to the base installation directory of the previous version).</li>
        <li>Complete the installer process.</li>
        <li>Start Openfire (when using a service, start it manually).</li>
    </ol>
    <p><b>Since 4.1.5 the installer will stop and reinstall the service and then start it again automatically.</b></p>
    
<h3>Windows EXE (upgrading from x86 to x64 version)</h3>
    <ol>
        <li>(fastest option) When running the x64 installer point it to the current installation folder of Openfire (by default C:\Program files (x86)\Openfire). If you have Openfire service installed (version prior 4.1.5), stop it first. During the installation it will install/reinstall the service and on the last step you will have to choose whether to run it.</li>
        <li>(safest option) When running the x64 installer point it to a new installation folder (by default C:\Program Files\Openfire). If you have Openfire service installed (version prior 4.1.5), stop it first. During the installation it will install/reinstall the service. On the last step check not to start the service. Copy the /conf, /embedded-db (if using this database), /plugins, /resources/security from the old installation folder to the new one. Manually start the services via Services control page.</li>
    </ol><br>
            
    <p>The upgrade guide has been tested against 4.1.4 and newer versions. It should work for older versions, but the results may be different for very old versions. You won't have to stop the service before the upgrade since the version 4.1.5. It will stop and reinstall it automatically.</p>

<h3>RPM - RedHat based unix systems (RHEL, CentOS, Fedora, etc)</h3>
    <ol>
        <li>Stop Openfire.</li>
        <li>Backup the Openfire installation directory.</li>
        <li>Backup the Openfire database. Note that the embedded database is backed up in step 2.</li>
        <li>Install the new RPM. Execute <i>rpm -Uvf openfire-3.3.3-1.i386.rpm</i> to update your current install</li>
        <li>Start Openfire.</li>
    </ol><br>

    <p>Remember that the server can be started in manual or automatic mode. Execute <i>/opt/openfire/bin/openfire.sh</i>
    to start in manual mode or execute <i>/etc/init.d/openfire start</i>  to start the server as a service. Execute
    <i>/etc/init.d/openfire stop</i> to stop the server's service.</p>

    <h4>Things to note</h4>
    <ul>
    <li>The new RPM installs Openfire as a service. That means that the server will be started when the OS is started and the server is stopped upon shutdown.</li>
    <li>/opt/openfire/bin/openfire no longer exists. It was a start/stop script generated by install4j. Since we are no longer using install4j, it needed to go. Instead, we now have a more standard linux init script, /etc/init.d/openfire.</li>
    <li>/etc/sysconfig/openfire can now be used to 'tweak' things, like paths and such. See the file for more information.</li>
    <li>The entire directory tree is owned by daemon now. We ditched the need for a new user and are sticking with a standard unix system account. The RPM will take care of owning everything as you install it.</li>
    <li>Beyond having /etc/init.d/openfire to stop and start openfire, it has chkconfig compatible tags in it and is automatically added via the rpm so that openfire should start up as your server starts up.</li>
    <li>The RPM will no longer overwrite: conf/openfire.xml, resources/security/keystore or resources/security/truststore.</li>
    </ul>

<h3>Mac OS X DMG</h3>
    <ol>
        <li>Stop Openfire.</li>
        <li>Backup the Openfire installation directory. The default is _/usr/local/wildfire_.</li>
        <li>Backup the Openfire database. Note that the embedded database is backed up in step 2.</li>
        <li>Open the installer for the new version of Openfire.</li>
        <li>Complete the installer process.</li>
    </ol>

<h3>ZIP or TAR.GZ</h3>
    <ol>
        <li>Stop Openfire.</li>
        <li>Backup the Openfire installation directory. This step is critical because the data will be overwritten with the new .tar.gz/zip install.</li>
        <li>Backup the Openfire database. Note that the embedded database is inside the installation directory and is backed up in step 2.</li>
        <li>Wipe out the contents of the Openfire installation directory (all folders and files).</li>
        <li>Extract the .tar.gz/zip file into the installation directory.</li>
        <li>Copy the <i>conf</i> directory from the backup to the installation directory.</li>
        <li>Copy the <i>embedded-db</i> directory from the backup to the installation directory.</li>
        <li>Copy the <i>enterprise</i> directory from the backup to the installation directory, if it exists.</li>
        <li>Copy the <i>plugins</i> directory from the backup to the installation directory except for _plugins/admin_.</li>
        <li>Copy modified files located in <i>resources/security</i> from the backup to the installation directory.</li>
        <li>Start Openfire</li>
    </ol>
</ul>

<h2>Special Upgrade cases</h2>
There are some special occasions where some manual intervention is needed while performing the upgrade process. This is
usually the case when some mayor refactoring work was done that requires complex upgrade operations. However, this is
not a common case in Openfire (e.g. this happened twice since 2003). Below you will find the upgrade steps to follow
for these special occasions:
<ul>
    <li><a href="wildfire-openfire-upgrade.html">Wildfire to Openfire Upgrade Guide</a></li>
    <li><a href="wildfire-ent-3_2_0-upgrade.html">Upgrade guide to Wildfire Enterprise 3.2.0</a></li>
</ul>

</div>

</div>

</body>
</html>
